<?php
function setmessage($nicknane, $message) {
    include '../config.php';
    $sql = "INSERT INTO messages (nickname, message) VALUES ('$nickname', '$message')";
    $conn->query($sql);
    $conn->close();
}
function getmessage($id) {
    include '../config.php';
    $sql = "SELECT * FROM messages WHERE id = '$id'";
    $result = $conn->query($sql);
    $conn->close();
    return $result->fetch_assoc();
}
function GetLevelByName($name) {
    include '../config.php';
    $sql = "SELECT * FROM userdata where bind_name = '$name'";
    $result = $conn->query($sql);
    $conn->close();
    return $result->fetch_assoc['level'];
}
?>
